package com.zkjl.protect_business.entity.base;

import com.zkjl.protect_business.common.UserThreadLocal;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * <p>
 * 实体基础类
 * </p>
 */
@Data
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = "上传时间")
    @Field(name = "create_time")
    private Long createTime;


    @ApiModelProperty(value = "上传机构id")
    @Field(name = "create_org_id")
    private String createOrgId;

    @ApiModelProperty(value = "上传机构名称")
    @Field(name = "create_org_name")
    private String createOrgName;


    @ApiModelProperty(value = "上传人id")
    @Field(name = "create_user_id")
    private String createUserId;

    @ApiModelProperty(value = "上传人")
    @Field(name = "create_user_name")
    private String createUserName;


    public void setBaseInfo() {
        this.createOrgId = UserThreadLocal.getOrgId();
        this.createOrgName = UserThreadLocal.getOrg();
        this.createUserId = UserThreadLocal.getUserId();
        this.createUserName = UserThreadLocal.getUserName();
        this.createTime = System.currentTimeMillis();
    }




}
